﻿using UnityEngine;
using System.Collections;

public class PauseMenuScript : MonoBehaviour {
	
	public Texture2D Settings;
	public Texture2D Help;
	public Texture2D ResumeGame;
	public Texture2D RestartLevel;
	public Texture2D ExitToMainMenu;
	
	void OnGUI ()
	{
		const int buttonWidth = 200;
		const int buttonHeight = 120;
		int buttonNo = 5;
		int ButtonDistance = 80;
		
		int ScreenHeight = Screen.height;
		//int MinusAmount = ScreenHeight * 0.8;

		
		
		// Draw a button for ResumeGame
		if 	(GUI.Button (new Rect (	(Screen.width / 2 - buttonWidth / 2) ,
		                           (Screen.height - (buttonNo*ButtonDistance - 5)),
		                           buttonWidth,
		                           buttonHeight),
		                 ResumeGame,		// Texture Name
		                 GUIStyle.none)
		     ) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.LoadLevel ("GameScreen");
		}
		buttonNo--;
		
		// Draw a button for Restart
		if 	(GUI.Button (new Rect (	(Screen.width / 2) - (buttonWidth / 2),
		                           (Screen.height - (buttonNo*ButtonDistance - 5)),
		                           buttonWidth,
		                           buttonHeight),
		                 RestartLevel,
		                 GUIStyle.none)
		     )
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			//Application.LoadLevel ("Gameplay");
			
		}
		buttonNo--;
		
		// Draw a button for Settings
		if 	(GUI.Button (new Rect (	(Screen.width) / 2 - (buttonWidth / 2),
		                           (Screen.height - (buttonNo*ButtonDistance - 5)),
		                           buttonWidth,
		                           buttonHeight),
		                 Settings,
		                 GUIStyle.none)
		     ) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.Quit ();
		}
		buttonNo--;
		
		// Draw a button for Help
		if 	(GUI.Button (new Rect (	(Screen.width) / 2 - (buttonWidth / 2),
		                           (Screen.height - (buttonNo*ButtonDistance - 5)),
		                           buttonWidth,
		                           buttonHeight),
		                 Help,
		                 GUIStyle.none)
		     ) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.Quit ();
		}
		buttonNo--;
		
		// Draw a button for Exit
		if 	(GUI.Button (new Rect (	(Screen.width) / 2 - (buttonWidth / 2),
		                           (Screen.height - (buttonNo*ButtonDistance - 5)),
		                           buttonWidth,
		                           buttonHeight),
		                 ExitToMainMenu,
		                 GUIStyle.none)
		     ) 
		{
			// On Click, load the first level.
			// "Stage1" is the name of the first scene we created.
			Application.Quit ();
		}
		buttonNo--;
		
	}
}
